-
Notifications
You must be signed in to change notification settings - Fork 54
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: parse userinfo provided in nomad address #423
base: main
Are you sure you want to change the base?
Conversation
9ef14cc
to
1da29d1
Compare
- allow to have a scheme in the address with basic auth - fix nil point dereference error
1da29d1
to
2430704
Compare
This is kinda... Eh. Maybe just |
more than happy to do that 👍 I'll make the change |
to make it more intuitive that the resulting address doesn't include userinfo
@stind Thanks for the PR. Typically the Nomad API client is configured using the However, I think it might be nice to be able to consume all of this from the NOMAD_ADDR itself, so I'd like to talk to some folks here and see if this is something that we can bring into the Nomad API package itself. Some quick context as to they why they're separate: Nomad itself has never (and still doesn't) support basic authentication itself. The basic authentication "support" was added for folks who are using a auth-enabled proxy in front of Nomad. |
Description
I was trying to use
nomad-pack
with address that includes basic auth, likehttp://user:pass@host
, and receivednil pointer dereference
error. That's because of the line withconf.HttpAuth.Username = user
(conf.HttpAuth
may be nil.)On top of that, I realized that the address is not parsed correctly when it includes both
scheme://
and userinfo:scheme://user:pass@addr
would be parsed asuser = "scheme"
,pass = "//user:pass"
,addr = "addr"